package io.renren.modules.evaluate.controller;

import io.renren.modules.evaluate.dao.NormMesDao;
import io.renren.modules.evaluate.service.ExcelService;
import io.renren.modules.sys.controller.SysLoginController;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/excel")

public class ExcelController {



    @Autowired
    HttpServletRequest request;
    @Autowired
    SysLoginController sysLoginController;
    @Autowired
    NormMesDao normMesDao;

    @Resource
    private ExcelService excelService;
    @ApiOperation("读取excel")
    @PostMapping("/dealFromFile")
    public List<Object> dealFromFile(MultipartFile file) {
       /* HttpSession session = request.getSession();
        System.out.println(session.getAttribute("user"));
*/      return excelService.dealFromFile(file);
    }

    @PostMapping("/dealFromUri")
    public List<Object> dealFromUri(String fileUri) {
        return excelService.dealFromUri(fileUri);
    }
}
